package com.meatball.authorization.data.dto

import com.meatball.core.validation.RoleNameValidity
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Size

/**
 * TODO 更新角色参数类
 *
 * @property name
 * @property description
 *
 * @author 张翔宇
 * @since 2024年3月26日
 */
@Schema(description = "新增角色参数")
data class UpdateRoleParams(
    @Schema(description = "角色ID", example = "1773177147784040448")
    @NotNull(message = "角色ID不能为空")
    val id: Long,

    @Schema(description = "角色名称", minLength = 5, maxLength = 50, example = "ROLE_USER")
    @NotBlank(message = "角色名称不能为空")
    @Size(min = 5, max = 50, message = "名称长度必须在5到50字符之间")
    @RoleNameValidity(message = "角色名称必须以ROLE_开头")
    val name: String,

    @Schema(description = "角色描述", maxLength = 50, example = "普通用户")
    @NotBlank(message = "角色描述不能为空")
    @Size(max = 50, message = "角色描述最大长度不能超过50个字符")
    val description: String
)
